<template>
  <div id="huishangdiv">
    <div v-if="listLoading" style="margin:20px;">正在加载...</div>
    <div v-else>
      <div v-if="mydata && mydata.length > 0">
        <el-button  @click="pinggushow()" style="right:60px;position:fixed;z-index:999" type="success">查看质量评估</el-button>
        <el-radio-group v-model="banziBaogao" style="float:left" @change="changeLeader">
          <el-radio-button label="全部"></el-radio-button>
          <el-radio-button v-for="(item, index) in leaders" :key="index" keys :label="item.name" >{{item.name}}</el-radio-button>
        </el-radio-group>
        <div style="clear:both;height:20px;"></div>
         <!-- 共 <b>{{SumBaogaoTiaoshu}}</b> 条问题 -->
        <el-card v-for="(item, index) in filterList" :key="index" keys class="" style="margin:0 0 20px 0">
          <div slot="header" class="clearfix">
            <span><b>班子成员姓名：</b><font style="color:#00f">{{item.banziPersonName}}</font></span>
          </div>
          <div class="text item" style="line-height:180%">
            <span><b>对群众反映、巡视反馈、组织约谈函询、个人需报告的重大事项和有关问题，以及遵守我部规范领导干部配偶、子女及其配偶经商办企业管理规定、履行保密工作责任制、遵守党员网络行为要求等情况,逐项作出说明。没有需要作出说明、检查事项的要“零报告”：</b>{{item.shiFou1}}</span>
          </div>
          <div class="text item" style="line-height:180%" v-show="item.shiFou1==='是'">
            <span><b>说明：</b>{{item.shuoMing1}}</span>
          </div>
          <!-- <div class="text item" style="line-height:180%">
            <span><b>是否对遵守领导干部配偶、子女及其配偶经商办企业管理规定、履行保密工作责任制等情况，逐项作出说明，受到谈话函询且存在违纪问题的要作出检讨，受到问责的要作出深刻检查：</b>{{item.shiFou2}}</span>
          </div>
          <div class="text item" style="line-height:180%" v-show="item.shiFou2==='是'">
            <span><b>说明：</b>{{item.shuoMing2}}</span>
          </div> -->
          <!-- <div class="text item" style="line-height:180%">
            <span><b>是否对履行保密工作责任制情况说清楚、谈透彻：</b>{{item.shiFou3}}</span>
          </div>
          <div class="text item" style="line-height:180%" v-show="item.shiFou3==='是'">
            <span><b>说明：</b>{{item.shuoMing3}}</span>
          </div>
          <div class="text item" style="line-height:180%">
            <span><b>是否对群众反映、巡视反馈、组织约谈函询的问题说清楚、谈透彻：</b>{{item.shiFou4}}</span>
          </div>
          <div class="text item" style="line-height:180%" v-show="item.shiFou4==='是'">
            <span><b>说明：</b>{{item.shuoMing4}}</span>
          </div> -->
          <hr style="height:1px;border:0;margin:20px 0;background:#EBEEF5;overflow:hidden">
          <div class="text item" style="line-height:180%;font-weight:bolder">
            备注：
          </div>
          <div class="text item" style="line-height:180%">
            {{item.remark}}
          </div>
        </el-card>
      </div>
      <div v-else style="padding:20px; font-size:14px;color:#999;text-align:center">暂无数据</div>
    </div>
  </div>
</template>
<script>
export default {
  props: {
    timestamp: '',
    leaders: []
  },
  data () {
    return {
      listLoading: false,
      mydata: null,
      banziBaogao: '全部',
      beipipingren: '全部',
      filterList: [],
      sumWenti: 0
    }
  },
  watch: {
    timestamp (val) {
      this.loaddata()
    },
    '$store.state.link_hz' (val) {
      this.activeNameHuishang = this.$store.state.link_hz
    }
    // $refs.tree2.getCurrentNode()
  },
  methods: {
    pinggushow () {
      var params1 = {Link1: 'Pingjia'}
      this.$store.commit('tablink1', params1)
    },
    changeLeader () {
      let key = this.banziBaogao
      let oldList = this.mydata
      if (key === '全部') {
        this.filterList = oldList
      } else {
        this.filterList = oldList.filter(item => {
          return item.banziPersonName === key
        })
      }
    },
    loaddata () {
      this.listLoading = true
      let para = {
        shenghuohuiunitId: this.$route.params.id,
        pageNum: 1,
        pageSize: 2000
      }
      this.$http
        .post(this.$http.defaults.shenghuohuiAPI + `api/newHsChengyuanbaogao/queryByPage`, para)
        .then(response => {
          this.listLoading = false
          if (response.data.success === true) {
            console.log('获取成功')
            this.mydata = response.data.result.records
            this.changeLeader()
          } else {
            console.log('获取数据失败:' + response.data.message)
            this.$message({
              message: '获取数据失败:' + response.data.message,
              type: 'error'
            })
          }
        })
        .catch(error => {
          console.log(error)
          this.$message({
            message: '网络获取失败:' + error,
            type: 'error'
          })
          this.listLoading = false
        })
    }
  }
}
</script>
<style scoped>
.el-form-item{
  margin:0;
}
</style>
<style>
#huishangdiv .el-form-item__label{
  font-size:16px;
}
.chuxi{
  color:green;
}
.nochuxi{
  color:red;
}
#huiyiyicheng .el-form-item__content{
  font-size:16px;
}
</style>
